package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.YcSubjectMainlyMapper;
import com.ruoyi.system.domain.YcSubjectMainly;
import com.ruoyi.system.service.IYcSubjectMainlyService;
import com.ruoyi.common.core.text.Convert;

/**
 * 学科分类Service业务层处理
 * 
 * @author 杨琛
 * @date 2020-11-20
 */
@Service
public class YcSubjectMainlyServiceImpl implements IYcSubjectMainlyService 
{
    @Autowired
    private YcSubjectMainlyMapper ycSubjectMainlyMapper;

    /**
     * 查询学科分类
     * 
     * @param id 学科分类ID
     * @return 学科分类
     */
    @Override
    public YcSubjectMainly selectYcSubjectMainlyById(Long id)
    {
        return ycSubjectMainlyMapper.selectYcSubjectMainlyById(id);
    }

    /**
     * 查询学科分类列表
     * 
     * @param ycSubjectMainly 学科分类
     * @return 学科分类
     */
    @Override
    public List<YcSubjectMainly> selectYcSubjectMainlyList(YcSubjectMainly ycSubjectMainly)
    {
        return ycSubjectMainlyMapper.selectYcSubjectMainlyList(ycSubjectMainly);
    }

    /**
     * 新增学科分类
     * 
     * @param ycSubjectMainly 学科分类
     * @return 结果
     */
    @Override
    public int insertYcSubjectMainly(YcSubjectMainly ycSubjectMainly)
    {
        ycSubjectMainly.setCreateTime(DateUtils.getNowDate());
        return ycSubjectMainlyMapper.insertYcSubjectMainly(ycSubjectMainly);
    }

    /**
     * 修改学科分类
     * 
     * @param ycSubjectMainly 学科分类
     * @return 结果
     */
    @Override
    public int updateYcSubjectMainly(YcSubjectMainly ycSubjectMainly)
    {
        ycSubjectMainly.setUpdateTime(DateUtils.getNowDate());
        return ycSubjectMainlyMapper.updateYcSubjectMainly(ycSubjectMainly);
    }

    /**
     * 删除学科分类对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYcSubjectMainlyByIds(String ids)
    {
        return ycSubjectMainlyMapper.deleteYcSubjectMainlyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除学科分类信息
     * 
     * @param id 学科分类ID
     * @return 结果
     */
    @Override
    public int deleteYcSubjectMainlyById(Long id)
    {
        return ycSubjectMainlyMapper.deleteYcSubjectMainlyById(id);
    }
}
